<template>
  <el-form :model="form" label-width="auto" size="large" class="my-form" :disabled="disabled">
    <el-form-item v-for="(item, index) in enterpriseInfo"
                  :label="item.label"
                  :key="index"
                  class="input-style">
      <el-input
          v-if="item.prop === 'dwjj'"
          v-model="form[item.prop]"
          :rows="4"
          type="textarea"
          :readonly="item.onlyRead"
      />
      <!--像Python字典的用法-->
      <el-input v-else
                v-model.trim="form[item.prop]"
                :readonly="item.onlyRead"
                style="height: 42px"
                class="input-style"/>
    </el-form-item>
    <el-form-item v-if="!disabled" class="input-style">
      <el-button style="margin-left: 225px;" class="min-w-xs" type="primary" size="large" @click="submitUpdate" round>
        提交修改<el-icon class="el-icon&#45;&#45;right"><Edit /></el-icon>
      </el-button>
    </el-form-item>
  </el-form>
</template>

<script setup>
import {enterpriseInfo} from "@/api/options/onePart/enterpriseInfo.js";
import {Edit} from '@element-plus/icons-vue'
import {ref} from "vue";

const props = defineProps(["form", "disabled"])
const emits= defineEmits(["submitUpdate"])
const submitUpdate = () => {
  emits("submitUpdate")
}
</script>

<style scoped>
.input-style {
  @apply class="flex items-center justify-center";
}
.my-form {
  font-size: 18px;
  font-weight: bold;
  color: black;
}
</style>